using System;
using System.IO;
using System.Collections;
using System.Text;

namespace VCDepend.Engine.Graphviz
{
	public class DotNode : IDotSerializable
	{
		public readonly string Name;
		private DotAttributes m_attributes;

		public DotNode(string name)
		{
			this.Name = name;
			m_attributes = new DotAttributes(" [", ",", "]");
		}

		public void Serialize(TextWriter writer)
		{
			writer.Write("{0}", DotUtil.EscapeDotString(this.Name));
			m_attributes.Serialize(writer);
			writer.Write(";");
		}

		public void SetAttribute(string name, string value)
		{
			m_attributes.SetAttribute(name, value);
		}
	}
}
